<?php
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'basic';
$return=array();
/*******basic*******/
if($_RQ['op']=='basic'){
	if($_RQ['postdata']){
		$postdata=get_postdata();
		$this->plugin_setting('basic',$postdata);
		if(!$postdata['host'] || !$postdata['username'] || !$postdata['password'] || !$postdata['port'] || !$postdata['database'] || !$postdata['tablepre']){
			exi('所有内容都要填写！','error');
		}
		//pdo_delete('jy_weishop_order_goods',array('uniacid'=>$_SESSION['uniacid'],'goodsid'=>array(0,1)));
		exi('设置成功');
	}
	$return['item']=$this->plugin_setting('basic')?:array('tablepre'=>'ims_','port'=>'3306');
	$htmls=array(
		'type'=>'edit',
		'desc'=>'参数设置',
		'edit_tab'=>true,
		'edits'=>array(
			array(
				'title'=>'基本信息',
				'list'=>array(
					array('type'=>'string','title'=>'源数据库地址','name'=>'host','help'=>'主机IP地址'),
					array('type'=>'string','title'=>'源数据库账号','name'=>'username','help'=>''),
					array('type'=>'password','title'=>'源数据库密码','name'=>'password','help'=>''),
					array('type'=>'string','title'=>'源数据库端口','name'=>'port','help'=>'默认：3306;注意：3306必须放行：扫描端口：https://tool.chinaz.com/port'),
					array('type'=>'string','title'=>'源数据库名称','name'=>'database','help'=>''),
					array('type'=>'string','title'=>'源数据库表前缀','name'=>'tablepre','help'=>'默认：ims_'),
					
				)
			),
		),
	);
	$return['htmls']=$htmls;
	exi($return);
}
/*******basic*******/
/*******op*******/
